package wangwenjun.phase2.concurrencypattern.eventbus.google.demo06;

import com.google.common.eventbus.DeadEvent;
import com.google.common.eventbus.Subscribe;
import lombok.extern.slf4j.Slf4j;

/**
 * @author ChangLiang
 * @date 2020/6/19
 */
@Slf4j
public class DeadEventListener {

    /**
     * DeadEvent 其有一个特点 就是知道event来自于哪一个bus
     * 并且其可以接收String Event，也可以接收Integer Event Apple Event也是可以的
     * @param deadEvent
     */

    @Subscribe
    public void handle(DeadEvent deadEvent) {
        log.warn("deadEvent source:{}", deadEvent.getSource().toString());
        log.warn("deadEvent event:{}", deadEvent.getEvent());
    }
}
